Skip to content

Add automated QC step in pecotmr#381

Merged
gaow merged 28 commits intoStatFunGen:mainfrom
rl3328:main
May 9, 2025
Merged

Add automated QC step in pecotmr#381
gaow merged 28 commits intoStatFunGen:mainfrom
rl3328:main

Conversation

@rl3328
Copy link
Copy Markdown
Collaborator

@rl3328 rl3328 commented Apr 17, 2025

Summary of Pipeline Updates

  1. Utility Function

    • Added a new function z_to_pvalue() in misc.R, which is now used twice in univariate_rss_diagnostics.R.
  2. Diagnostics Functions

    • Included all functions used for diagnostics table in univariate_rss_diagnostics.R for modularity and reusability.
  3. Pipeline Modification

    • Modified rss_analysis_pipeline() to include a new parameter:
      diagnostics (default: FALSE).

    • When diagnostics = TRUE, the pipeline performs additional steps:

      Step 1: Generate Diagnostics Table

      • Extract and process information from the first finemapping analysis, which should satisfy in this automated QC:
        • finemapping_method == "susie_rss"
        • qc_method == "rss_qc"
        • impute == TRUE
      • The output is a diagnostics table summarizing study-block level results.

      Step 2: Trigger Additional Analyses Based on Diagnostics

      • For each study_block:
        • If CS > 1:

          • Check for any spurious credible sets, defined as:
            p_value > 1e-4 or cs_corr_max > 0.5
          • If spurious CS exists:
            • Run BCR (impute, rss_qc)
            • Run SER (non_impute, noqc)
          • If not spurious:
            • Keep the original BVSR result (from first analysis)
        • Else (CS == 1 or no CS found):

          • Run SER (non_impute, noqc)
          • Note: I recommend not replacing the first finemapping result with the new SER output, as some BVSR results may be more informative.
    • I modified the naming of method layer to distinguish the orginal and additional results. I didn't store the sumstats after impute and qc for additional analyses.

  4. Documentation

    • Updated the documentation to reflect these changes.

I tested using chr11_84267999_86714492 data in AD_GWAS summary statistics, it worked.

@rl3328 rl3328 changed the title Add automated QC step in pecotmr(WIP) Add automated QC step in pecotmr Apr 20, 2025
@rl3328 rl3328 changed the title Add automated QC step in pecotmr Add automated QC step in pecotmr(WIP) Apr 20, 2025
@rl3328 rl3328 changed the title Add automated QC step in pecotmr(WIP) Add automated QC step in pecotmr Apr 20, 2025
@gaow gaow merged commit 2180f64 into StatFunGen:main May 9, 2025
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants